With the development of wireless communications technologies, such as the third-generation mobile communications (3G) and the fourth-generation mobile communications (LTE) technologies, the wireless Internet has become an important networking method. With the 3G and/or LTE communication network infrastructure, portable smart terminal devices such as smart phones or tablet computers have been growing fast in development and become very popular. Accessing wireless Internet through portable intelligent terminal devices has gradually become one of the most important networking methods.
A browser is a key application on an intelligent terminal used for accessing the Internet. Limited by its size, the portable intelligent terminal device cannot be equipped with bulky large-capacity memories. Therefore, given the amount of total memory available, memory usage of the browser during browsing can significantly affect user experience. Excessive memory usage by the browser during browsing can cause the browser to run more slowly, have a long response lag, or have a freeze, thus affecting the user experience.
To improve the browsing experience, memory usage of the browser needs to be optimized, so that the browser does not occupy excessive system resources. Memory used for browsing large-capacity data such as pictures is an important cause for excessive memory usage by the browser. Therefore, how to save memory used for browsing web page pictures becomes an important topic for optimization. One solution includes a method of reducing size and color bit depth of the pictures. Because memory dedicated to a picture=picture length×picture width×color bit depth, theoretically, this solution can save system (memory) resources.
However, this solution has an issue: even though the size and the color bit depth of the picture are reduced, the picture will still be displayed in the original picture size and will suffer from a low resolution. For example, when a user wants to browse a screenshot of chat history, the chat content will not be displayed clearly after the size and the color bit depth of the original screenshot are reduced. Therefore, by this solution, the size and color bit depth of a picture in practice can only be reduced to a certain degree such that the quality effect is unaffected.
Another solution includes periodically clearing picture memory usage, administered by a timer. For example, after a timer is started in a browser, memory used for browsing pictures is monitored periodically and a threshold is set to avoid frequent re-decoding for releasing memories dedicated to pictures.
However, such solution cannot clear the excessively occupied memory in time, because the timer has a delay. Moreover, a delay of several seconds exists before the monitoring begins. Further, setting the memory threshold for the timer can cause the following problems: if the threshold is too small, despite the fact that memory can be released, it still causes frequent decoding, thus aggravating freezes of the browser; if the threshold is too large, excessive memory occupancy cannot be reduced effectively.
Therefore, a method and an apparatus that can timely and effectively release memory usage of a browser on a portable terminal device are desirable.